1. Field of the Invention
The present invention relates to a printing apparatus that is operated according to real-time commands transmitted from a host computer and a method for processing real-time commands using the same, and more particularly, to a printing apparatus capable of being stably operated without any mechanical troubles such as degraded performance of the printing apparatus, which are caused when real-time commands are analyzed and processed on a receive interrupt routine, by detecting real-time commands from data transmitted from the host computer, separately storing the detected real-time commands in a real-time command buffer and processing the stored real-time commands in preference to the other data, and a method for processing real-time commands using the same.
2. Description of the Related Art
In general, printing apparatuses, which are coupled to a personal computer to print documents or photographs, or which are provided in data processing apparatuses (i.e. POS terminals and cash registers used for monetary transactions in stores) to print receipts, perform their printing operations, depending on print data and command data transmitted from the host computer.
However, such various errors that a printer paper runs out and is jammed in a printing apparatus, and a cover of a printing apparatus is opened may be caused during the use of the printing apparatuses. When theses errors are caused, conventional printing apparatuses are brought to a halt, and then prevent data from continuously being transmitted from a host computer by switching off an interface connected with the host computer. Therefore, as control operations in the printing apparatus are then brought to a halt, the printing apparatus does not process the already received data and perform operations on commands from the host computer any more.
In this case, the host computer displays a dialog box that there is an error in a printing apparatus, brings a printing apparatus' operation to a halt, and then maintains the halting of the printing apparatus until a user manually solve the problem to convert a state of the corresponding printing apparatus into an on-line state.
Accordingly, when errors in the printing operation are detected in the art, users experience much inconvenience in solving the problems, and will not perform any operations until the problems are solved. In particular, since the printing operation is engaged with a cash register or a POS terminal, its errors may cause inconvenience to the store's clients.
In order to solve the foregoing problems, there has been proposed a technology of classifying commands to be processed in real time into real-time commands and processing the real-time commands in preference to common commands. More particularly, data received from a host computer are divided into two types: real-time commands and common data. Then, the common data are stored in a receive buffer, and the real-time commands are analyzed while being received.
However, when the real-time commands are processed in this manner, for example, when the real-time commands are received from a host computer to transmit state information of the printing apparatus in real time, or to control a mechanism or external apparatuses of the printing apparatus, a data receiving unit receives data from the host computer, and simultaneously analyzes the received data. Here, the processing of the data is performed on a data receive interrupt routine. When analyzing and processing of data are performed at the same time on the data receive interrupt routine as described above, if the analyzing and processing of the previously received data are not completed while the receiving, the processing of newly received real-time commands may be problematic to be performed.
More particularly, when a host computer requests state information of a printing apparatus in real time, the real-time transmission of the state information of the printing apparatus may be delayed due to the errors caused on the interface between the host computer and the printing apparatus. This transmission delay causes such problems that, in order to execute real-time commands that will be subsequently received into a receive interrupt, the execution of the next received real-time commands waits until the transmission of delayed state information is completed, or the transmission of the delayed state information should be renounced. In case the execution of the next received real-time commands waits until the transmission of the state information is completed, the performance of the printing apparatus may be deteriorated with the low data receiving rate. On the contrary, when the transmission of the delayed state information is renounced, wrong information may be transmitted.
Also, when operations of the mechanism and peripheral devices of the printing apparatus are delayed in receiving real-time control commands, which are used to control the mechanism or peripheral devices of the printing apparatus in real time, from a host computer and executing the received real-time control commands, the next received real-time commands waits until the execution of the previous real-time control commands is completed, or the execution of the previous real-time control commands should be renounced. When the next received real-time commands waits until the execution of the previous real-time control commands is completed, the performance of the printing apparatus may be deteriorated with the low data receiving rate. On the contrary, when the execution of the previous real-time control commands is renounced, undesirable operations may be performed. The operations of the mechanism and peripheral devices of the printing apparatus may be delayed when a predetermined time is required to complete the operations of the mechanism and peripheral devices, or when there are errors in the operations of the mechanism and peripheral devices.